<template>
    <div>
        <div class="containers">
            <div class="body">
            <div class="bgLogo">
                <img class="ground_img1" src="@/assets/img/index1.png" alt=""> 
                <div style="position:absolute">
                    <img class="ground_img2" src="@/assets/img/index2.png" alt="">
                    <span class="pen">纳品网后台管理系统</span>
                </div>
                </div>
            <div class="telNumber">
                <img class="ground_img3" src="@/assets/img/index3.png" alt="">
                <input type="text" placeholder="请输入您的账号" v-model="account">
            </div>
            <div class="telNumber">
                <img class="ground_img4" src="@/assets/img/index4.png" alt="">
                <input type="password" placeholder="请输入密码" v-model="password" style="margin-left: 6vw;">
            </div>
            </div>
            <div class="login" align="center" @click="getLogin">登陆</div>
        </div>
    </div>
</template>
<script>
import request from "@/request/index.js"
export default {
    data(){
        return{
            account:'',
            password:'',
            isLogin:true,
        }
    },
    methods: {
        getLogin(){
            if(this.password&&this.account){
                if(this.isLogin){
                    request.checkLogin(this)
                }else{

                }
                
            }else{              
                if(!this.account){
                    this.$toast('请输入账号')
                }else if(!this.password){
                    this.$toast('请输入密码')
                }
            }
        }
    },
    mounted(){
        this.$store.commit('metionChange',0)
    }
}
</script>
<style scoped lang="scss">
.bgLogo{
    position: relative;
    >div{
        position: absolute;
        top: 50%;
        left:50%;
        margin-left: -75px;
        margin-top: -46px;
        width: 150px;
        text-align: center;
        .pen{
            font: 1em sans-serif;
            color: #ffffff;
            display: block;
        }
        .ground_img2{
            width: 68px;
            height: 68px;
        }
    }
}
.containers{
  width: 100vw;
  height: 100vh;
//   background: #f5f5f5;
  .login{
    width: 72vw;
    height: 10.67vw;
    margin: 0px auto;
    margin-top: 80vw;
    text-align: center;
    background-color: #1ABC9C;
    color: #fff;
    line-height: 10.67vw;
    font-size: 16px;
    border-radius: 6vw;
  }
    .body{
      width: 100vw;
      height: 26.67vw;
      background: #fff;

      .agree{
        float: left;
        font-size: 11px;
        text-indent: 4vw;
          span{
            color: #ff4c50;
          }
      }
        .telNumber{
          width: 90vw;
          line-height: 40px;
          border-bottom: 1px solid #f5f5f5;
          background: #eeeeee;
          border-radius: 8px;
          margin: 0 auto;
          padding: 0px 10px;
          margin-top: 15px;
          input{
              background: #eeeeee;
              
          }
          .getcode{
            width: 26.67vw;
            height: 8vw;
            background: #ff4c50;
            border-radius: 4vw;
            color: #fff;
            float: right;
            font-size: 15px;
            line-height: 8vw;
            text-align: center;
            margin-top: 2vw;
            margin-right: 5vw;
          }
          input{
            width:51vw;
            margin-left: 4.3vw;
            position: relative;
            font-size: 14px;
          }
          img{
            width: auto;
            height: auto;
            vertical-align: middle;
          }
        }
    }
}
</style>


